import javax.swing.text.html.parser.Entity;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class LearnHashMap {
    //不允许重复
    public static void main(String[] args) {

        HashMap<String, Integer> map = new HashMap();
        map.put("axiba1",456);
        map.put("axiba2",458);
        map.put("axiba3",457);

        Set<String> set = map.keySet();
        for(String a : set){
            System.out.print(a+":");
            System.out.println(map.get(a));
        }
        map.remove("axiba1");
        System.out.println(map.containsKey("axiba1"));
        map.put("axiba4",888);
        System.out.println(map.containsKey("axiba4"));

        Set<Map.Entry<String,Integer>> entry = map.entrySet(); //将键值和key拆分
        for(Map.Entry<String,Integer> entry1 : entry){
            System.out.print(entry1.getKey()+":");
            System.out.println(entry1.getValue());
        }
    }
}
